﻿using DataMonitorMysql.MappingClass;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataMonitorMysql.MappingClassConfig
{
    internal class dm_props_user_config : IEntityTypeConfiguration<dm_props_user>
    {
        public void Configure(EntityTypeBuilder<dm_props_user> builder)
        {
            builder.ToTable("dm_props_user");
            builder.HasKey(b => b.key);
            builder.Property(a => a.ip).HasMaxLength(255).IsRequired();
            builder.Property(a => a.vehicle).HasMaxLength(255).IsRequired();
            builder.Property(a => a.watchpath).HasMaxLength(500).IsRequired();
            builder.Property(a => a.logpath).HasMaxLength(500).IsRequired();
            builder.Property(a => a.echart1chan).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart1title).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart2chan).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart2title).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart3chan).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart3title).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart4chan).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart4title).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart5chan).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart5title).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart6chan).HasMaxLength(255).IsRequired();
            builder.Property(a => a.echart6title).HasMaxLength(255).IsRequired();
            builder.Property(a => a.remarks).HasMaxLength(255).IsRequired();
            builder.Property(a => a.person).HasMaxLength(255).IsRequired();
            builder.Property(a => a.email).HasMaxLength(255).IsRequired();
            builder.Property(a => a.can0).HasColumnType("smallint(5) unsigned").IsRequired();
            
            builder.Property(a => a.idcount).HasColumnType("smallint(5) unsigned").IsRequired();
        }
    }

    
    
}
